<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<div class="easyui-layout" fit="true">
    <div region="center" style="padding: 1px;">
        <t:datagrid name="qqOptionList" title="" actionUrl="qqOptionController.do?datagrid&qId=${qId}" idField="id" fit="true"
                    queryMode="group" onLoadSuccess="loadSuccess" pagination="false">
            <t:dgCol title="主键" field="id" hidden="true"></t:dgCol>
            <t:dgCol title="名称" field="name"  width="3"></t:dgCol>
            <t:dgCol title="标识" field="optionIdentity"  width="1"></t:dgCol>
            <t:dgCol title="分数" field="score"  width="1"></t:dgCol>
            <t:dgCol title="回答" field="replyType" dictionary="answerType" width="1"></t:dgCol>

            <t:dgCol title="common.operation" field="opt" width="1"></t:dgCol>
            <t:dgDelOpt url="qqOptionController.do?del&id={id}" title="删除"></t:dgDelOpt>

            <t:dgToolBar title="新增" icon="icon-add" url="qqOptionController.do?addorupdate&qsId=${qId}" funname="add" width="600"
                         height="550"></t:dgToolBar>
            <t:dgToolBar title="修改" icon="icon-edit" url="qqOptionController.do?addorupdate&qsId=${qId}" funname="f_updateInfo"
                         width="600" height="550"></t:dgToolBar>
            <%--<t:dgToolBar title="详情" icon="icon-search" url="questController.do?detail" funname="f_detail"  width="600" height="550"></t:dgToolBar>--%>

        </t:datagrid>
    </div>
</div>
<script type="text/javascript">



//    $(function () {
//        var li_east = 0;
//        alert(1111);
//    });
    function f_updateInfo(title, url, id, width, height) {
        gridname = id;
        var rowsData = $('#' + id).datagrid('getSelections');
        if (!rowsData || rowsData.length == 0) {
            tip('请选择编辑选项');
            return;
        }
        if (rowsData.length > 1) {
            tip('请选择一条选项再编辑');
            return;
        }

        url += '&id=' + rowsData[0].id;
        createwindow(title, url, width, height);
    }
//
//    function f_detail(title, url, id, width, height) {
//        gridname = id;
//        var rowsData = $('#' + id).datagrid('getSelections');
//        if (!rowsData || rowsData.length == 0) {
//            tip('请选择量表');
//            return;
//        }
//        if (rowsData.length > 1) {
//            tip('请选择一条量表再查看');
//            return;
//        }
//
//        url += '&id=' + rowsData[0].id;
//        createwindow(title, url, width, height);
//    }
//
//    //查看
//    function f_detail(title, url, id, width, height){
//        gridname=id;
//        var rowsData = $('#'+id).datagrid('getSelections');
//        if (!rowsData || rowsData.length==0) {
//            tip('请选择量表');
//            return;
//        }
//        if (rowsData.length>1) {
//            tip('请选择一个量表');
//            return;
//        }
//        url += '&id='+rowsData[0].id;
//        title="咨询师预览";
//        createdetailwindow(title, url, width, height);
//    }

</script>
